<template>
  <div :class="$style.page">
    <div :class="$style.imgBox">
      <img :src="data.effect.pics[0].url" alt>
      <div :class="$style.border">
        <div :class="$style.buttonWrap" @click="previewFn">
          <span :class="$style.text">查看效果图</span>
          <span :class="$style.arrow">
            <img src="~/static/images/Rectangle2.png" alt>
          </span>
        </div>
      </div>
    </div>
    <div :class="$style.textBox">
      <div :class="$style.title">{{data.title}}</div>
      <div :class="$style.txt">{{data.companyName}}</div>
      <div :class="$style.lpSize">
        <img src="~/static/images/mj.png" :class="$style.icon1">
        <span>{{data.acre}}</span>
        <img src="~/static/images/ys.png" :class="$style.icon2">
        <span>{{data.sum}}</span>
      </div>
    </div>
    <div :class="$style.button" @click="subscribe" id="btn" v-if="showSubscribe">点击预约</div>
  </div>
</template>

<script>
export default {
  props: ["data", "showNav", "showSubscribe"],
  methods: {
    previewFn() {
      this.$parent.$parent.show();
    },
    subscribe() {
      this.$parent.$parent.subscribe();
    }
  }
};
</script>
<style lang="less" module>
.page {
  width: 100%;
  height: 100%;
  position: relative;
  overflow: hidden;
  background: url("~/static/images/bg1.png") center center no-repeat;
  background-size: 100% 100%;
  background-size: cover;
  .imgBox {
    position: relative;
    width: 648px;
    height: 432px;
    margin: 168px 64px 0 38px;
    > img {
      width: 100%;
      height: 100%;
    }
    .border {
      position: absolute;
      width: 643px;
      height: 428px;
      top: 34px;
      left: 32px;
      border: 4px solid #ffae34;
      .buttonWrap {
        position: absolute;
        left: 50%;
        top: 50%;
        transform: translate3d(-50%, -50%, 0);
        width: 222px;
        height: 62px;
        background: rgba(51, 51, 51, 0.6);
        border-radius: 28px;
        border: 1px solid #fdc15f;
        display: flex;
        justify-content: center;
        align-items: center;
        cursor: pointer;
        .text {
          font-size: 24px;
          color: #fff;
          padding-right: 12px;
        }
        .arrow {
          > img {
            width: 14px;
            height: 23px;
          }
        }
      }
    }
  }
  .textBox {
    margin-top: 68px;
    margin-left: 56px;
    font-size: 32px;
    .title {
      font-weight: 500;
    }
    .txt {
      margin-top: 32px;
    }
    .lpSize {
      display: flex;
      margin-top: 26px;
      font-size: 0;
      .icon1,
      .icon2 {
        width: 24px;
        height: 24px;
        vertical-align: middle;
        margin-right: 16px;
        margin-top: 2px;
        display: inline-block;
      }
      .icon2 {
        margin-left: 34px;
      }
      span {
        vertical-align: middle;
        font-size: 28px;
        line-height: 1;
      }
    }
  }

  .button {
    margin: 158px auto 0;
    text-align: center;
    width: 350px;
    height: 60px;
    line-height: 60px;
    background: #ffae34;
    border-radius: 10px;
    font-size: 36px;
    position: relative;
    z-index: 10;
    color: #fff;
    &.disabled {
      background: #e5e2e2;
      pointer-events: none;
      color: #fff;
    }
    &.hide {
      display: none;
    }
  }
}
</style>
